package com.jlz.beans.core;

import java.util.List;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import com.julewa.db.DB;
import com.julewa.db.Entity;

/*
 * 处理关联消息
 * 
 * 求租,承租,提醒...
 * 
 * 这个信息将很重要
 * 
 */
@Component @Scope(Entity.SCOPE)
public class MessageBean {

	@DB.KEY long createDate; //
	@DB.KEY int idx;//用以保证不重复,每1小时重设一次即可
	
	@DB.COLUMN long expiryDate; //最晚有效日期,不超过3天,VIP可以多几天,甚至自设
	
	//求租,承租,续租
	@DB.COLUMN int type;
	@DB.COLUMN int categoryId;//适度冗余

	//必须注册,才能发送接收站内消息
	@DB.COLUMN long senderId;//发送者,如果为0,则为提醒消息
	@DB.COLUMN long recieverId;//接收者
	//
	@DB.COLUMN String names;//这个写到一块儿算了用\t分开就好了,用作冗余处理
	//
	@DB.COLUMN long assetId;//目标资源,asset|desire
	//提示涨价或降价?
	//二者都有认可或者不认可,为结束状态
	//二者都删除或者过期,则可随时清理
	@DB.COLUMN int senderState;//发送状态,新建-发送-认可-不认可-删除
	@DB.COLUMN int recieverState;//接收-认可-不认可-删除
	//
	
	//关键的价格信息,要传达出去,也方便于判断,当然也可以不指定
	List<PriceBean> prices;
	//
	@DB.COLUMN(max=256) String message;
	public long getCreateDate() {
		return createDate;
	}
	public void setCreateDate(long createDate) {
		this.createDate = createDate;
	}
	public int getIdx() {
		return idx;
	}
	public void setIdx(int idx) {
		this.idx = idx;
	}
	public long getExpiryDate() {
		return expiryDate;
	}
	public void setExpiryDate(long expiryDate) {
		this.expiryDate = expiryDate;
	}
	public int getType() {
		return type;
	}
	public void setType(int type) {
		this.type = type;
	}
	public int getCategoryId() {
		return categoryId;
	}
	public void setCategoryId(int categoryId) {
		this.categoryId = categoryId;
	}
	public long getSenderId() {
		return senderId;
	}
	public void setSenderId(long senderId) {
		this.senderId = senderId;
	}
	public long getRecieverId() {
		return recieverId;
	}
	public void setRecieverId(long recieverId) {
		this.recieverId = recieverId;
	}
	public String getNames() {
		return names;
	}
	public void setNames(String names) {
		this.names = names;
	}
	public long getAssetId() {
		return assetId;
	}
	public void setAssetId(long assetId) {
		this.assetId = assetId;
	}
	public int getSenderState() {
		return senderState;
	}
	public void setSenderState(int senderState) {
		this.senderState = senderState;
	}
	public int getRecieverState() {
		return recieverState;
	}
	public void setRecieverState(int recieverState) {
		this.recieverState = recieverState;
	}
	public List<PriceBean> getPrices() {
		return prices;
	}
	public void setPrices(List<PriceBean> prices) {
		this.prices = prices;
	}
	public String getMessage() {
		return message;
	}
	public void setMessage(String message) {
		this.message = message;
	}
	
	//
	
}
